module exclusive_sel(/*AUTOARG*/
   // Outputs
   o_dat,
   // Inputs
   i_sel, i_dat
   );
   parameter width = 8;
   parameter num = 4;			// select one from "num" input each width is "width"
   
   output logic [width-1:0] o_dat;
   input logic [num-1:0] 	i_sel;
   input logic [num-1:0][width-1:0] i_dat;

   logic [width-1:0] 				dat;

   always_comb
	 begin
		dat = '0;
		for(int i=0;i<num;i++)
		  dat |= {width{i_sel[i]}} & i_dat[i];
	 end

   assign o_dat = dat;
endmodule // exclusive_sel
